<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;


class CreateRentClothDetailTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rent_cloth_detail', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->comment('=users.id');
            $table->integer('rent_id')->comment('=rent_clothes.id');
            $table->integer('commodity_id')->comment('=commodities.id');
            $table->integer('commodity_attr_id')->comment('=commodity_attr.id');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE `rent_cloth_detail` comment '租衣详情表';");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rent_cloth_detail');
    }
}
